/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Vistas_Internas;

import rmi.Servidor;

/**
 * Powered by Ing. Diego Ariza
 * @Email : diego.ariza2@gmail.com
 * @author n0rf3n
 * @version 1.0
 */
public class ServidorRmi extends javax.swing.JInternalFrame {

    /**
     * Creates new form Rmi
     */
    public ServidorRmi() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        lblServidor = new javax.swing.JLabel();
        btnServidorRMI = new javax.swing.JButton();
        lblInfoBD = new javax.swing.JLabel();
        lblServidorRMI = new javax.swing.JLabel();

        setClosable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Servidor RMI");

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N
        jLabel1.setText("Servidor RMI");

        jLabel2.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N
        jLabel2.setText("Mensaje del Servidor RMI :");

        lblServidor.setForeground(new java.awt.Color(0, 204, 0));
        lblServidor.setText(" ");

        btnServidorRMI.setText("Iniciar Servidor RMI");
        btnServidorRMI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnServidorRMIActionPerformed(evt);
            }
        });

        lblInfoBD.setForeground(new java.awt.Color(204, 0, 0));
        lblInfoBD.setText(" ");

        lblServidorRMI.setText(" ");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup()
                                .add(37, 37, 37)
                                .add(jLabel1))
                            .add(btnServidorRMI))
                        .add(229, 229, 229))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel2)
                            .add(lblServidor, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 605, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, lblInfoBD, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 588, Short.MAX_VALUE)
                                .add(org.jdesktop.layout.GroupLayout.LEADING, lblServidorRMI, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel1)
                .add(18, 18, 18)
                .add(btnServidorRMI)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel2)
                .add(18, 18, 18)
                .add(lblServidor)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lblInfoBD)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lblServidorRMI)
                .addContainerGap(24, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnServidorRMIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnServidorRMIActionPerformed
       
        Servidor ser = new Servidor();
        lblInfoBD.setText(ser.getInfoconexionBD());
        lblServidor.setText(ser.getInfoServidorRMI());
        
        lblServidorRMI.setText("El servidor RMI esta a la espera de la conexión de clientes.!!");
        
    }//GEN-LAST:event_btnServidorRMIActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnServidorRMI;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel lblInfoBD;
    private javax.swing.JLabel lblServidor;
    private javax.swing.JLabel lblServidorRMI;
    // End of variables declaration//GEN-END:variables
}
